import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import config from '@/config'

Vue.use(Router)

export default new Router({
  mode: 'hash',
  base: config.baseUrl,
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/groupsend',
      name: 'groupsend',
      redirect: '/groupsend/new',
      children: [
        {
          path: 'new',
          name: 'NewGroupSend',
          component: ()=>import('./views/groupSend/NewGroupSend.vue')
        },
        {
          path: 'history',
          name: 'GroupSendHistory',
          component: ()=>import('./views/groupSend/GroupSendHistory.vue')
        }
      ],
      component: () => import(/* webpackChunkName: "groupsend" */ './views/groupSend/GroupSend.vue')
    },
    {
      path: '/addfriend',
      name: 'addfriend',
      redirect: '/addfriend/friend',
      children: [
        {
          path: 'friend',
          name: 'Friend',
          component: () => import('./views/addFriends/AddNormalFriend.vue')
        },
        {
          path: 'group',
          name: 'Group',
          component: () => import('./views/addFriends/AddGroupFriend.vue')
        },
        {
          path: 'verify',
          name: 'Verify',
          component: () => import('./views/addFriends/FriendVerify.vue')
        }
      ],
      component: () => import(/* webpackChunkName: "addfriend" */ './views/addFriends/AddFriends.vue')
    },
    {
      path: '/marketing',
      name: 'marketing',
      children: [
        {
          path: 'creategroup',
          name: 'creategroup',
          component: ()=>import('./views/marketing/CreateGroup.vue')
        },
        {
          path: 'discuss',
          name: 'discuss',
          component: ()=>import('./views/marketing/AddDiscuss.vue')
        },
        {
          path: 'group',
          name: 'group',
          component: ()=>import('./views/marketing/AddDiscuss.vue')
        },
        {
          path: 'friendresponse',
          name: 'friendresponse',
          component: ()=>import('./views/marketing/NewFriendResponse.vue')
        },
        {
          path: 'keyword',
          name: 'keyword',
          component: ()=>import('./views/marketing/Keyword.vue')
        },
        {
          path: 'ncode',
          name: 'ncode',
          component: ()=>import('./views/marketing/Ncode.vue')
        },
        {
          path: 'autoreply',
          name: 'autoreply',
          component: ()=>import('./views/marketing/AutoReply.vue')
        },
        {
          path: 'vipmanager',
          name: 'vipmanager',
          component: ()=>import('./views/marketing/VipManager.vue')
        },
        {
          path: 'groupfission',
          name: 'groupfission',
          component: ()=>import('./views/marketing/GroupFission.vue')
        }
      ],
      component: () => import(/* webpackChunkName: "marketing" */ './views/marketing/Marketing.vue')
    },
    {
      path: '/moments',
      name: 'moments',
      redirect: '/moments/publish',
      children: [
        {
          path: 'browse',
          name: 'browse',
          component: ()=>import('./views/moments/BrowseMoments.vue')
        },{
          path: 'publish',
          name: 'publish',
          component: ()=>import('./views/moments/PublishMoments.vue')
        },
      ],
      component: () => import(/* webpackChunkName: "moments" */ './views/moments/Moments.vue')
    },
    {
      path: '/groupmanage',
      name: 'groupmanage',
      redirect: '/groupmanage/welcome',
      children: [
        {
          path: 'welcome',
          name: 'welcome',
          component: ()=>import('./views/groupManage/Welcome.vue')
        },{
          path: 'release',
          name: 'release',
          component: ()=>import('./views/groupManage/Release.vue')
        },{
          path: 'reply',
          name: 'reply',
          component: ()=>import('./views/groupManage/Reply.vue')
        },{
          path: 'tag',
          name: 'tag',
          component: ()=>import('./views/groupManage/Tag.vue')
        },{
          path: 'membermanage',
          name: 'membermanage',
          component: ()=>import('./views/groupManage/MemberManage.vue')
        },{
          path: 'blacklist',
          name: 'blacklist',
          component: ()=>import('./views/groupManage/Blacklist.vue')
        }
      ],
      component: () => import(/* webpackChunkName: "groupmanage" */ './views/groupManage/GroupManage.vue')
    },
    {
      path: '/statistics',
      name: 'statistics',
      redirect: '/statistics/chat',
      children: [
        {
          path: 'chat',
          name: 'chat',
          component: ()=>import('./views/statistic/ChatStatistic.vue')
        },{
          path: 'group',
          name: 'group',
          component: ()=>import('./views/statistic/GroupStatistic.vue')
        },{
          path: 'invite',
          name: 'invite',
          component: ()=>import('./views/statistic/InviteStatistic.vue')
        }
      ],
      component: () => import(/* webpackChunkName: "statistics" */ './views/statistic/Statistics.vue')
    },
    {
      path: '/contact',
      name: 'contact',
      component: () => import(/* webpackChunkName: "contact" */ './views/addressbook/AddressBook.vue')
    }
  ]
})
